package com.hqd.ch03.v51.boot.autoconfigure;

import com.hqd.ch03.v51.boot.SpringBootConfiguration;
import com.hqd.ch03.v51.boot.context.TypeExcludeFilter;
import com.hqd.ch03.v51.context.annotation.ComponentScan;
import com.hqd.ch03.v51.context.annotation.Configuration;
import com.hqd.ch03.v51.context.annotation.FilterType;
import com.hqd.ch03.v51.core.annotation.AliasFor;
import com.hqd.ch03.v51.factory.support.BeanNameGenerator;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
        @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class)})
public @interface SpringBootApplication {

    @AliasFor(annotation = EnableAutoConfiguration.class)
    Class<?>[] exclude() default {};

    @AliasFor(annotation = EnableAutoConfiguration.class)
    String[] excludeName() default {};

    @AliasFor(annotation = ComponentScan.class, attribute = "basePackages")
    String[] scanBasePackages() default {};

    @AliasFor(annotation = ComponentScan.class, attribute = "basePackageClasses")
    Class<?>[] scanBasePackageClasses() default {};

    @AliasFor(annotation = ComponentScan.class, attribute = "nameGenerator")
    Class<? extends BeanNameGenerator> nameGenerator() default BeanNameGenerator.class;

    @AliasFor(annotation = Configuration.class)
    boolean proxyBeanMethods() default true;

}

